<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /**
         * 警告框alert(): 简单的显示消息，会调用toString转为字符串
         * 确认框confirm(): 点击确定返回true取消false
        */

        // confrim
       if (confirm('Are you sure')) { 
        alert('ok')
       } else { 
        alert('what is the fake')
       }

       // prompt
       let res = prompt('Are you sure', 'LeiJun')
       if (res) { 
        alert(res)
       } else { 
        alert('what is the fake')
       }

       
    </script>
</body>
</html>